var socket;

function send() {
	socket.send('Hello world');
}

function main() {
	try {
		socket = new ns.Connection();

		var webGLmanager = new ns.WebGLmanager("canvas", "shader-vs",
				"shader-fs");
		webGLmanager.init();
		var gl = webGLmanager.getContext();
		var shaderProgram = webGLmanager.getShaderProgram();

		var canvas = document.getElementById("canvas");
		var width = canvas.width;
		var height = canvas.height;

		var shaderManager = new ns.ShaderManager(gl, shaderProgram, width,
				height);
		shaderManager.init();

		var vertices = [0.0, 1.0, 0.0,
		                -1.0, -1.0, 0.0,
		                1.0, -1.0, 0.0];
		shaderManager.initBuffer(vertices);
		
		shaderManager.drawScene();

	} catch (e) {
		console.error(e);
	}
}
